package com.example.administrator.szb.common;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;

import com.example.administrator.szb.R;
import com.example.administrator.szb.util.ScreenUtils;

import static com.umeng.socialize.utils.ContextUtil.getContext;

/**
 * Created by stone on 2018/1/19.
 */

public class SetStatusBar {
    public static void setBar(View view, Context context){
        View v_statusbar = (View) view.findViewById(R.id.v_statusbar);
        v_statusbar.setBackgroundColor(context.getResources().getColor(R.color.basecolor));
        ViewGroup.LayoutParams params = v_statusbar.getLayoutParams();
        params.height = ScreenUtils.getStatusBarHeight(getContext());
        v_statusbar.setLayoutParams(params);
    }
    public static void setBar2(View view, Context context){
        View v_statusbar = (View) view.findViewById(R.id.v_statusbar);
        v_statusbar.setBackgroundColor(context.getResources().getColor(R.color.basecolor));
        ViewGroup.LayoutParams params = v_statusbar.getLayoutParams();
        params.height = ScreenUtils.getStatusBarHeight(getContext());
        v_statusbar.setLayoutParams(params);
    }
}
